<extend name="layout/home" />
<block name="title"><title>我的全部订单</title></block>
<block name="header">
	<div class="header">
    	<a class="fanhui" onClick="javascript:window.history.back()">
            <img class="hd_ltb" src="__PUBLIC__/home/img/tb-1.png"/>
            <p class="hd_fh">返回</p>
        </a>
        <p class="hd_cpxq">我的</p>
        <img class="hd_r" src="__PUBLIC__/home/img/tb-3.png"/>
    </div>
</block>
<block name="content">
    <div class="wd_nav">
    	<a class="wd_nav_a wd_nav_active" href="__URL__/allOrder">全部订单</a>
        <a class="wd_nav_a" href="__URL__/waitPay">待付款</a>
        <a class="wd_nav_a" href="__URL__/send">待发货</a>
        <a class="wd_nav_a" href="__URL__/rec">待收货</a>
    </div>
    <ul class="wd_pp">
        <foreach name="order" item="all">
        	<li>
            	<!-- <div class="gwc_pp_t">
                    <img class="gwc_pic" src="img/logo-al.png"/>
                    <p class="gwc_p1">安利&gt;</p>
                    <p class="gwc_p11">卖家已发货</p>
                </div> -->
            <foreach name="all[goods]" item="goods">
            	<ul class="gwc_sp">
                	<li>
                    	<img class="gwc_pic_cp" src="__PUBLIC__/Uploads/goods/{$goods.pic}"/>
                        <div class="gwc_cp_xs">
                            <p class="gwc_p3">{$goods.gname}({$goods.size})</p>
                            <p class="gwc_p4">&yen;{$goods['buyprice']+$goods['buypv']}</p>
                            <p class="gwc_p5">&times;{$goods.buycnt}</p>
                            <p class="gwc_p6">通粉优惠：&yen;{$goods.buyprice}+{$goods.buypv}PV</p>
                        </div> 
                    </li>
                </ul>
            </foreach>
                <div class="wd_cp_gj">
                	<p class="wd_cp_gjp1">共{$all.zj}件商品</p>
                    <p class="wd_cp_gjp2">合计：&yen;{$all.ormb}+{$all.opv}PV（含运费：&yen;0.00）</p>
                    <if condition="$all['status'] eq 0"><form action="__URL__/pay" method="get"><input type="hidden" name="cash" value="{$all.ormb}"><input type="hidden" name="pv" value="{$all.opv}"><input class="wd_cp_fk" type="submit" value="去付款"></form>
                        <elseif condition="$all['status'] eq 1"/>
                            <a class="wd_cp_fk" id="remind_send">提醒卖家发货</a>
                        <elseif condition="$all['status'] eq 2"/>
                            <a class="wd_cp_fk" id="shkey" oid="{$all.oid}">确认收货</a>
                            <a class="wd_cp_fk wd_cp_fk01" href="__URL__/trade">查看物流</a>
                            <a class="wd_cp_fk wd_cp_fk01" href="#">延长收货</a>
                        <else />完成
                    </if>
                </div>
            </li>
        <div class="kong"></div>
        </foreach>
    </ul>
    <div class="kong"></div>
    <script type="text/javascript">
    $('#shkey').click(function(){
        if(confirm('确认收货')){
            var oid = $(this).attr('oid');
            $.ajax({
            url:'orderStatus',
            data:{'oid':oid},
            dataType:'',
            type:'POST',
            success:function(mes){
                if(mes){
                    alert('交易完成!');
                    location.reload();
                }
            }
            });
        }
    });
    $('#remind_send').click(function(){
        alert('已催促商家发货!');
    });
    </script>
</block>
